/**
 * @Author: colpu
 * @Date: 2025-03-29 19:38:16
 * @LastEditors: colpu ycg520520@qq.com
 * @LastEditTime: 2025-10-21 17:11:08
 * @
 * @Copyright (c) 2025 by colpu, All Rights Reserved.
 */
import { join } from "node:path";
import { addDirectory } from "../../utils/index.js";
/**
 * Load app/service
 * @function loadService
 * @since 1.0.0
 */
export default async function loadService(ctx) {
  ctx.timing.time("Load Service");
  const directory = [join(ctx.root, "src/service")];
  directory.push(...addDirectory(join(ctx.root, "src/modules"), 'service'));
  // 载入到 app.service
  const options = {
    caseStyle: "lower",
    directory,
    iscall: false,
  };
  await ctx.loadToContext(directory, "service", options);
  ctx.timing.timeEnd("Load Service");
}
